package org.jtzc.springaiagent.agent.reflective;

import org.jtzc.springaiagent.agent.BaseAgent;
import org.springframework.ai.chat.client.ChatClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * @author wu chuang
 * @description 销售
 */
@Service
public class CriticAgent implements BaseAgent {

    @Autowired
    private ChatClient chatClient;


    @Override
    public AgentResponse execute(AgentRequest request) {
        String system = "你做为一个裁判,给出合理的判断,如果满意回答中包含: good";
        String response = chatClient.prompt().system(system).user(request.prompt()).call().content();
        return new AgentResponse(response, Map.of("CriticAgent", "gpt-4"));
    }
}
